In general, a data communication apparatus used to perform data transfer control such as a router, a switch, or an access point is operated in a state of continuously running including not only when data communication is performed but also when no data communication is performed.
In such an operation, since power is consumed even when no communication is performed, unnecessary power consumption occurs from this viewpoint. Therefore, if control is performed such that the data communication apparatus enters a sleep state when no communication is performed, it is possible to reduce power consumption.
In order to appropriately set the sleep state corresponding to a period of no communication, it is necessary to accurately detect a timing at which data communication ends. A transmission control protocol (TCP) is widely used as a communication protocol over a network. In the TCP, it is prescribed that a communication terminal apparatus which wishes to terminate communication needs to turn an FIN flag or an RST flag on included in a TCP header. Therefore, as it is detected that the FIN flag or the RST flag included in a received packet is turned on, it is possible to detect an end timing of data communication.
However, in a best effort type network, due to disconnection of a communication line, a communication path failure, or unexpected power off of a communication apparatus, there is a possibility of communication being forcibly terminated before a communication transaction is finished. In this case, since communication ends while the FIN flag or the RST flag is set off, it is difficult to detect a communication end timing.
Therefore, a technique of determining a case in which a next frame is not acquired within a predetermined time after a previous frame is acquired as a timeout has been known (for example, refer to Patent Document 1). In such a configuration, even when communication is terminated while the FIN flag or the RST flag is set off due to some causes, it is possible to obtain a result corresponding to the detection of the communication end timing.